package cn.gzjp.modules.gas.entity;

import cn.hutool.core.date.DateUtil;
import org.hibernate.validator.constraints.Length;

import cn.gzjp.common.persistence.DataEntity;
import cn.gzjp.common.utils.excel.annotation.ExcelField;

import java.math.BigDecimal;
import java.util.Date;

/**
 * 充值Entity
 * @author zengcp
 * @version 2018-03-12
 */
public class GasRecharge extends DataEntity<GasRecharge> {
	
	private static final long serialVersionUID = 1L;
	private String openid;		// openid 获得者
	private BigDecimal amount;		// 充值金额
	private BigDecimal give;//赠送金额
	private Integer payStatus;		// 支付状态0未支付1 已支付

	private String  wxOrderId;//微信流水id

	private BigDecimal freeMoney;//赠送金额

	private BigDecimal moneyTotal;//总金额

	private BigDecimal orderPay;//实际支付

	private String startCity;		// 发货城市
	private String startDistrict;// 区
	private String endCity;		// 目的城市
	private String endDistrict;// 区

	private String startProvince;
	private String endProvince;

	private String content;//奖励金

	private Date startDate;
	private Date endDate;

	private String unionId;

	private String comeFrom;//0自己的 1别人提供的(推广奖励金)



	private String supportOpenid;//奖励金提供者

	public BigDecimal getOrderPay() {
		return this.getAmount();
	}

	public void setOrderPay(BigDecimal orderPay) {
		this.orderPay = orderPay;
	}


	public BigDecimal getMoneyTotal() {
		return this.getAmount().add(this.getGive());
	}

	public void setMoneyTotal(BigDecimal moneyTotal) {
		this.moneyTotal = moneyTotal;
	}

	public BigDecimal getFreeMoney() {
		return this.getGive();
	}

	public void setFreeMoney(BigDecimal freeMoney) {
		this.freeMoney = freeMoney;
	}

	public GasRecharge() {
		super();
	}

	public GasRecharge(String id){
		super(id);
	}

	@Length(min=0, max=32, message="openid长度必须介于 0 和 32 之间")
	@ExcelField(title="openid", align=2, sort=1)
	public String getOpenid() {
		return openid;
	}

	public void setOpenid(String openid) {
		this.openid = openid;
	}
	
	@ExcelField(title="充值金额", align=2, sort=2)
	public BigDecimal getAmount() {
		return amount;
	}

	public void setAmount(BigDecimal amount) {
		this.amount = amount;
	}
	
	@ExcelField(title="支付状态0未支付1 已支付", align=2, sort=3)
	public Integer getPayStatus() {
		return payStatus;
	}

	public void setPayStatus(Integer payStatus) {
		this.payStatus = payStatus;
	}

	public BigDecimal getGive() {
		return give;
	}

	public void setGive(BigDecimal give) {
		this.give = give;
	}

	public String getWxOrderId() {
		return wxOrderId;
	}

	public void setWxOrderId(String wxOrderId) {
		this.wxOrderId = wxOrderId;
	}

	public String getDate(){
		return DateUtil.format(this.getCreateDate(), "MM月dd日 HH:mm");
	}

	public String getStartCity() {
		return startCity;
	}

	public void setStartCity(String startCity) {
		this.startCity = startCity;
	}

	public String getStartDistrict() {
		return startDistrict;
	}

	public void setStartDistrict(String startDistrict) {
		this.startDistrict = startDistrict;
	}

	public String getEndCity() {
		return endCity;
	}

	public void setEndCity(String endCity) {
		this.endCity = endCity;
	}

	public String getEndDistrict() {
		return endDistrict;
	}

	public void setEndDistrict(String endDistrict) {
		this.endDistrict = endDistrict;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public Date getStartDate() {
		return startDate;
	}

	public void setStartDate(Date startDate) {
		this.startDate = startDate;
	}

	public Date getEndDate() {
		return endDate;
	}

	public void setEndDate(Date endDate) {
		this.endDate = endDate;
	}

	public String getUnionId() {
		return unionId;
	}

	public void setUnionId(String unionId) {
		this.unionId = unionId;
	}

	public String getStartProvince() {
		return startProvince;
	}

	public void setStartProvince(String startProvince) {
		this.startProvince = startProvince;
	}

	public String getEndProvince() {
		return endProvince;
	}

	public void setEndProvince(String endProvince) {
		this.endProvince = endProvince;
	}

	public String getComeFrom() {
		return comeFrom;
	}

	public void setComeFrom(String comeFrom) {
		this.comeFrom = comeFrom;
	}

	public String getSupportOpenid() {
		return supportOpenid;
	}

	public void setSupportOpenid(String supportOpenid) {
		this.supportOpenid = supportOpenid;
	}
}